-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Adding dave2d driver support on lvgl for Renesas RA devices #97163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Adding dave2d driver support on lvgl for Renesas RA devices #97163
Conversation
afdac7c
to
fcd57a6
Compare
The following west manifest projects have changed revision in this Pull Request:
Additional metadata changed:
⛔ DNM label due to: 2 projects with PR revision, 1 project with metadata changes and 1 blob change Note: This message is automatically posted and updated by the Manifest GitHub Action. |
c5f52c9
to
198bda1
Compare
Thank you for bringing this one @duynguyenxa, I was about to ask you about the progress on this. |
2212a8d
to
7c3cf66
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only Dave2D I know is https://m.youtube.com/channel/UCVYamHliCI9rw1tHR1xbkfw :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces D/AVE 2D hardware acceleration support for LVGL on Renesas RA devices (RA8D1, RA8P1), enabling GPU-accelerated graphics rendering for improved UI performance. The integration includes driver implementation, device tree bindings, board configurations, and demo updates.
Key Changes
- Adds Renesas DRW (D/AVE 2D) driver with interrupt handling and memory management
- Updates module revisions to pull in LVGL dave2d support and Renesas HAL changes
- Configures board support and display timing optimizations for RA8D1/RA8P1 platforms
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
west.yml | Updates module revisions for hal_renesas and lvgl to pull in dave2d support |
drivers/misc/renesas_drw/ | New DRW driver implementation with interrupt handling and memory allocation |
dts/bindings/misc/renesas,ra-drw.yaml | Device tree binding for DRW hardware |
dts/arm/renesas/ra/ra8/ | Device tree node definitions for DRW on RA8D1/RA8P1 SoCs |
boards/renesas/ | Board-specific DRW enablement and interrupt configuration |
modules/lvgl/Kconfig | LVGL configuration for dave2d draw engine support |
samples/modules/lvgl/demos/ | Demo configuration updates for widgets and performance monitoring |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
7c3cf66
to
a85b72c
Compare
The overall driver looks good now, although I am missing the hardware to test it. Also the pending issue around the LVGL fork sync needs to be addressed first I guess. |
config RENESAS_RA_DRW | ||
bool "Renesas RA DRW Driver" | ||
depends on DT_HAS_RENESAS_RA_DRW_ENABLED | ||
select USE_RA_FSP_DRW if SOC_FAMILY_RENESAS_RA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check redundant? It is already passed by DT_HAS_RENESAS_RA_DRW_ENABLED.
select USE_RA_FSP_DRW if SOC_FAMILY_RENESAS_RA | |
select USE_RA_FSP_DRW |
uint32_t int_status; | ||
IRQn_Type irq = R_FSP_CurrentIrqGet(); | ||
/* Read D/AVE 2D interrupt status */ | ||
int_status = R_DRW->STATUS; | ||
/* Get current IRQ number */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better for readability
uint32_t int_status; | |
IRQn_Type irq = R_FSP_CurrentIrqGet(); | |
/* Read D/AVE 2D interrupt status */ | |
int_status = R_DRW->STATUS; | |
/* Get current IRQ number */ | |
uint32_t int_status = R_DRW->STATUS; /* Read D/AVE 2D interrupt status */ | |
IRQn_Type irq = R_FSP_CurrentIrqGet(); /* Get current IRQ number */ |
#define DRW_INIT(inst) \ | ||
static int drw_renesas_ra_configure_func_##inst(void) \ | ||
{ \ | ||
R_ICU->IELSR[DT_INST_IRQ_BY_NAME(inst, drw, irq)] = ELC_EVENT_DRW_INT; \ | ||
IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, drw, irq), \ | ||
DT_INST_IRQ_BY_NAME(inst, drw, priority), drw_zephyr_irq_handler, \ | ||
DEVICE_DT_INST_GET(inst), 0); \ | ||
irq_enable(DT_INST_IRQ_BY_NAME(inst, drw, irq)); \ | ||
return 0; \ | ||
} \ | ||
static int renesas_drw_init_##inst(const struct device *dev) \ | ||
{ \ | ||
ARG_UNUSED(dev); \ | ||
return drw_renesas_ra_configure_func_##inst(); \ | ||
} \ | ||
DEVICE_DT_INST_DEFINE(inst, renesas_drw_init_##inst, NULL, NULL, NULL, POST_KERNEL, \ | ||
CONFIG_RENESAS_DRW_INIT_PRIORITY, NULL); | ||
|
||
DT_INST_FOREACH_STATUS_OKAY(DRW_INIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use the SYS_INIT
, due to this is a singleton instance driver
d1_device_flex *p_context = (d1_device_flex *)R_FSP_IsrContextGet(irq); | ||
|
||
if (p_context->dlist_indirect_enable && | ||
(NULL != (uint32_t *)*(p_context->pp_dlist_indirect_start))) { | ||
R_DRW->DLISTSTART = *(p_context->pp_dlist_indirect_start); | ||
p_context->pp_dlist_indirect_start++; | ||
} else { | ||
k_sem_give(&d1_queryirq_sem); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better for readability
d1_device_flex *p_context = (d1_device_flex *)R_FSP_IsrContextGet(irq); | |
if (p_context->dlist_indirect_enable && | |
(NULL != (uint32_t *)*(p_context->pp_dlist_indirect_start))) { | |
R_DRW->DLISTSTART = *(p_context->pp_dlist_indirect_start); | |
p_context->pp_dlist_indirect_start++; | |
} else { | |
k_sem_give(&d1_queryirq_sem); | |
} | |
} | |
d1_device_flex *p_d1_handle = (d1_device_flex *)R_FSP_IsrContextGet(irq); | |
if (p_d1_handle != NULL) { | |
uint32_t **pp_dlist_indirect_start = (uint32_t **)p_d1_handle->pp_dlist_indirect_start; | |
if (p_d1_handle->dlist_indirect_enable && *pp_dlist_indirect_start != NULL) { | |
R_DRW->DLISTSTART = *pp_dlist_indirect_start; | |
p_d1_handle->pp_dlist_indirect_start++; | |
} else { | |
k_sem_give(&d1_queryirq_sem); | |
} | |
} | |
} |
R_DRW->IRQCTL = DRW_PRV_IRQCTL_ALLIRQ_CLEAR_AND_DLISTIRQ_ENABLE; | ||
R_FSP_IsrContextSet((IRQn_Type)VECTOR_NUMBER_DRW_INT, handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base on the d1_shutdownirq_intern
, I think we should move the irq_enable(VECTOR_NUMBER_DRW_INT);
from init function to here.
Beside that, maybe you'd like to swap the call order?
R_DRW->IRQCTL = DRW_PRV_IRQCTL_ALLIRQ_CLEAR_AND_DLISTIRQ_ENABLE; | |
R_FSP_IsrContextSet((IRQn_Type)VECTOR_NUMBER_DRW_INT, handle); | |
R_FSP_IsrContextSet((IRQn_Type)VECTOR_NUMBER_DRW_INT, handle); | |
irq_enable(VECTOR_NUMBER_DRW_INT); | |
R_DRW->IRQCTL = DRW_PRV_IRQCTL_ALLIRQ_CLEAR_AND_DLISTIRQ_ENABLE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! It will simplify a lot the Weather Demo from Renesas under Zephyr.
DEVICE_DT_INST_DEFINE(inst, renesas_drw_init_##inst, NULL, NULL, NULL, POST_KERNEL, \ | ||
CONFIG_RENESAS_DRW_INIT_PRIORITY, NULL); | ||
|
||
DT_INST_FOREACH_STATUS_OKAY(DRW_INIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DT_INST and its foreach version is also responsible to manage the allocation of the driver instance and runtime data, there are examples on how to instantiate singleton devices ( check the video input subsystems) but I'd rather to leave this as is because the runtime result will be the same of using a cusom singleton initialization flow.
This commit update commit ID for Renesas hal and lvgl module to support dave2d library Signed-off-by: Duy Nguyen <[email protected]>
First commit to add support for Renesas RA drw driver Signed-off-by: Duy Nguyen <[email protected]>
Add DRW nodes to r7fa8d1xh.dtsi and r7ka8p1kflcac.dtsi Signed-off-by: Duy Nguyen <[email protected]>
Add support for drw driver on ek_ra8p1 and ek_ra8d1 Signed-off-by: Duy Nguyen <[email protected]>
Adjust GLCDC panel timing parameters for rtklcdpar1s00001be display shield Signed-off-by: Duy Nguyen <[email protected]>
Add extra configs in sample.yaml to LVGL demos for Renesas EK-RA8P1 and EK-RA8D1 boards. Add new overlay file for EK-RA8P1 to adjust flash partitions. Signed-off-by: Duy Nguyen <[email protected]>
a85b72c
to
a37e85d
Compare
|
This PR introduces support for D/AVE 2D (Dave2D) hardware acceleration in LVGL on Zephyr OS.
The integration allows LVGL’s rendering engine to utilize the Renesas D/AVE 2D GPU for improved graphics performance, enabling faster UI updates and smoother animations on supported hardware platforms (e.g., RA8D1, RA8P1).